package com.wtwd.campus.fjryE15.enumeration;

/**
 * @author mjy
 * @date 2022/09/21
 * @description
 */
public enum PhoneEnum {

    SOS_PHONE(1, 3, 1, 3, "sos号码"),
    FAMILY_PHONE(2, 3, 4, 6, "亲情号"),
    WHITE_PHONE(2, 17, 7, 24, "白名单"),
    ;
    /**
     * 号码类型
     */
    private Integer type;

    /**
     * 最大设置号码个数
     */
    private Integer maxLength;

    /**
     * 最低键位
     */
    private Integer minSequence;

    /**
     * 最高键位
     */
    private Integer maxSequence;

    /**
     * 描述
     */
    private String msg;

    PhoneEnum(Integer type, Integer maxLength, Integer minSequence, Integer maxSequence, String msg) {
        this.type = type;
        this.maxLength = maxLength;
        this.minSequence = minSequence;
        this.maxSequence = maxSequence;
        this.msg = msg;
    }

    public static PhoneEnum getCmd(Integer type) {
        for (PhoneEnum r : PhoneEnum.values()) {
            if (r.getType() == type) {
                return r;
            }
        }
        return null;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public Integer getMaxLength() {
        return maxLength;
    }

    public void setMaxLength(Integer maxLength) {
        this.maxLength = maxLength;
    }

    public Integer getMinSequence() {
        return minSequence;
    }

    public void setMinSequence(Integer minSequence) {
        this.minSequence = minSequence;
    }

    public Integer getMaxSequence() {
        return maxSequence;
    }

    public void setMaxSequence(Integer maxSequence) {
        this.maxSequence = maxSequence;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }
}
